<template>
  <div class="mainbox">
    <el-container>
      <el-header>
        <div class="logo" style="background-color: #199ed8;">
          <div class="left" style="background-color: #199ed8;">
            <p style="color: #fff; margin-left: 15px; font-size: 22px;">
              数据展示系统
            </p>
          </div>
          <div class="centerWrap" style="background-color: #199ed8;">
            <div class="center">
              <el-row :gutter="20">
               <el-button type="primary" size="default">ceshi</el-button>
               
              </el-row>
            </div>
          </div>
          <div class="right" style="background-color: #199ed8;">
            <p>
              <el-button icon="el-icon-user-solid" circle></el-button>
            </p>
          </div>
        </div>
      </el-header>
      <el-container>
        <el-aside width="200px">
          <el-menu
            default-active="1"
            class="el-menu-vertical-demo"
            background-color="#545c64"
            text-color="#fff"
            active-text-color="#ffd04b"
            :router="true"
          >
            <el-submenu
              :index="'one' + index"
              v-for="(item, index) in menulist.menus"
              :key="item.name"
            >
              <template slot="title">
                <i class="el-icon-location"></i>
                <span>{{ item.name }}</span>
              </template>
              <el-menu-item
                v-for="child in item.children"
                :key="child.name"
                :index="child.path"
              >
                {{ child.name }}
              </el-menu-item>
            </el-submenu>
          </el-menu>
        </el-aside>
        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
export default {
  data() {
    return {
      menulist: {},
    }
  },
  created() {
    this.getmenulist()
    this.getrouters()
  },
  mounted() {},
  methods: {
    onSubmit() {
      this.$router.push({ path: '/login' })
    },
    async getmenulist() {
      this.menulist = await require('../assets/menus.json')
    },
    async getrouters() {},
  },
}
</script>

<style scoped lang="less">
.mainbox,
.el-container,
.el-header,
.el-aside {
  margin: 0;
  padding: 0;
  height: 100%;
  background-color: #2d3d4d;
}
.el-menu {
  border-right: none;
}

.el-aside {
  background-color: #5d6d7d;
}
.el-main {
  background-color: #fff;
}
.logo {
  display: table;
  width: 100%;
  height: 100%;
  table-layout: fixed;
}

.left,
.right,
.centerWrap {
  display: table-cell;
}

.left,
.right {
  width: 200px;
  vertical-align: middle;
}
.right p {
  margin-right: 15px;
  float: right;
}

.center {
  height: 100%;
  float: right;
  display: flex;
  align-items: center;
  .el-row {
    margin: 0px !important;
  }
}

.logo span {
  font-size: 18px;
  color: #fff;
}
</style>
